.class Lde/dealdoktor/app/activities/Comments$GetCommentsTask;
.super Landroid/os/AsyncTask;
.source "Comments.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lde/dealdoktor/app/activities/Comments;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "GetCommentsTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/Void;",
        "Ljava/lang/Boolean;",
        ">;"
    }
.end annotation


# instance fields
.field private comments:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lde/dealdoktor/app/data/CommentDAO;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lde/dealdoktor/app/activities/Comments;


# direct methods
.method public constructor <init>(Lde/dealdoktor/app/activities/Comments;)V
    .locals 0
    .parameter

    .prologue
    .line 86
    iput-object p1, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    .line 85
    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    return-void
.end method


# virtual methods
.method protected varargs doInBackground([Ljava/lang/String;)Ljava/lang/Boolean;
    .locals 6
    .parameter "args"

    .prologue
    const/4 v5, 0x0

    .line 113
    :try_start_0
    iget-object v3, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->commentsPage:I
    invoke-static {v3}, Lde/dealdoktor/app/activities/Comments;->access$3(Lde/dealdoktor/app/activities/Comments;)I

    move-result v3

    invoke-static {v3}, Lde/dealdoktor/app/data/DataModel;->getRecentComments(I)Ljava/util/ArrayList;

    move-result-object v3

    iput-object v3, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->comments:Ljava/util/ArrayList;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 118
    iget-object v3, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->comments:Ljava/util/ArrayList;

    if-eqz v3, :cond_1

    .line 119
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 120
    .local v2, ids:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    iget-object v3, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->comments:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_0

    .line 124
    :try_start_1
    iget-object v3, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    invoke-static {v2}, Lde/dealdoktor/app/data/DataModel;->getPostsForIds(Ljava/util/ArrayList;)Ljava/util/ArrayList;

    move-result-object v4

    #setter for: Lde/dealdoktor/app/activities/Comments;->posts:Ljava/util/ArrayList;
    invoke-static {v3, v4}, Lde/dealdoktor/app/activities/Comments;->access$8(Lde/dealdoktor/app/activities/Comments;Ljava/util/ArrayList;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 129
    const/4 v3, 0x1

    invoke-static {v3}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    .line 131
    .end local v2           #ids:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    :goto_1
    return-object v3

    .line 114
    :catch_0
    move-exception v1

    .line 115
    .local v1, e:Ljava/lang/Exception;
    const-string v3, "exception"

    const-string v4, "ProgressTask doInBackground"

    invoke-static {v3, v4, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 116
    invoke-static {v5}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    goto :goto_1

    .line 120
    .end local v1           #e:Ljava/lang/Exception;
    .restart local v2       #ids:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    :cond_0
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lde/dealdoktor/app/data/CommentDAO;

    .line 121
    .local v0, c:Lde/dealdoktor/app/data/CommentDAO;
    iget-object v4, v0, Lde/dealdoktor/app/data/CommentDAO;->postId:Ljava/lang/String;

    invoke-virtual {v2, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 125
    .end local v0           #c:Lde/dealdoktor/app/data/CommentDAO;
    :catch_1
    move-exception v1

    .line 126
    .restart local v1       #e:Ljava/lang/Exception;
    const-string v3, "exception"

    const-string v4, "ProgressTask doInBackground"

    invoke-static {v3, v4, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 127
    invoke-static {v5}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    goto :goto_1

    .line 131
    .end local v1           #e:Ljava/lang/Exception;
    .end local v2           #ids:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    :cond_1
    invoke-static {v5}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    goto :goto_1
.end method

.method protected bridge varargs synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter

    .prologue
    .line 1
    check-cast p1, [Ljava/lang/String;

    invoke-virtual {p0, p1}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->doInBackground([Ljava/lang/String;)Ljava/lang/Boolean;

    move-result-object v0

    return-object v0
.end method

.method protected onPostExecute(Ljava/lang/Boolean;)V
    .locals 4
    .parameter "success"

    .prologue
    const/4 v3, 0x0

    .line 94
    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 97
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->posts:Ljava/util/ArrayList;
    invoke-static {v0}, Lde/dealdoktor/app/activities/Comments;->access$2(Lde/dealdoktor/app/activities/Comments;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_0

    .line 98
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->commentsPage:I
    invoke-static {v0}, Lde/dealdoktor/app/activities/Comments;->access$3(Lde/dealdoktor/app/activities/Comments;)I

    move-result v1

    add-int/lit8 v1, v1, 0x1

    #setter for: Lde/dealdoktor/app/activities/Comments;->commentsPage:I
    invoke-static {v0, v1}, Lde/dealdoktor/app/activities/Comments;->access$4(Lde/dealdoktor/app/activities/Comments;I)V

    .line 99
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->listAdapter:Lde/dealdoktor/app/adapter/CommentsListAdapter;
    invoke-static {v0}, Lde/dealdoktor/app/activities/Comments;->access$5(Lde/dealdoktor/app/activities/Comments;)Lde/dealdoktor/app/adapter/CommentsListAdapter;

    move-result-object v0

    iget-object v1, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->comments:Ljava/util/ArrayList;

    iget-object v2, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->posts:Ljava/util/ArrayList;
    invoke-static {v2}, Lde/dealdoktor/app/activities/Comments;->access$2(Lde/dealdoktor/app/activities/Comments;)Ljava/util/ArrayList;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lde/dealdoktor/app/adapter/CommentsListAdapter;->addData(Ljava/util/ArrayList;Ljava/util/ArrayList;)V

    .line 100
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #setter for: Lde/dealdoktor/app/activities/Comments;->isLoading:Z
    invoke-static {v0, v3}, Lde/dealdoktor/app/activities/Comments;->access$1(Lde/dealdoktor/app/activities/Comments;Z)V

    .line 102
    :cond_0
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->isLoading:Z
    invoke-static {v0}, Lde/dealdoktor/app/activities/Comments;->access$6(Lde/dealdoktor/app/activities/Comments;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 103
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->loadingView:Landroid/view/View;
    invoke-static {v0}, Lde/dealdoktor/app/activities/Comments;->access$7(Lde/dealdoktor/app/activities/Comments;)Landroid/view/View;

    move-result-object v0

    const v1, 0x7f0b003b

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    .line 104
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    #getter for: Lde/dealdoktor/app/activities/Comments;->loadingView:Landroid/view/View;
    invoke-static {v0}, Lde/dealdoktor/app/activities/Comments;->access$7(Lde/dealdoktor/app/activities/Comments;)Landroid/view/View;

    move-result-object v0

    const v1, 0x7f0b003d

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V

    .line 109
    :cond_1
    :goto_0
    return-void

    .line 107
    :cond_2
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    const-string v1, "Bei der \u00dcbertragung ist ein Fehler aufgetreten. Keine Kommentare gefunden."

    const/4 v2, 0x1

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    goto :goto_0
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    check-cast p1, Ljava/lang/Boolean;

    invoke-virtual {p0, p1}, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->onPostExecute(Ljava/lang/Boolean;)V

    return-void
.end method

.method protected onPreExecute()V
    .locals 2

    .prologue
    .line 89
    iget-object v0, p0, Lde/dealdoktor/app/activities/Comments$GetCommentsTask;->this$0:Lde/dealdoktor/app/activities/Comments;

    const/4 v1, 0x1

    #setter for: Lde/dealdoktor/app/activities/Comments;->isLoading:Z
    invoke-static {v0, v1}, Lde/dealdoktor/app/activities/Comments;->access$1(Lde/dealdoktor/app/activities/Comments;Z)V

    .line 90
    return-void
.end method
